package com.xiaoshuidi.cloud.module.rooms.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaoshuidi.cloud.module.rooms.mapper.RoomDevicePeakValleyPriceMapper;
import com.xiaoshuidi.cloud.module.rooms.pojo.RoomDevicePeakValleyPrice;
import com.xiaoshuidi.cloud.module.rooms.service.IRoomDevicePeakValleyPriceService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 阶梯水电价格表 服务实现类
 * </p>
 *
 * @author Jax
 * @since 2024-08-16
 */
@Service
public class RoomDeviceSpeakValleyPriceServiceImpl extends ServiceImpl<RoomDevicePeakValleyPriceMapper, RoomDevicePeakValleyPrice> implements IRoomDevicePeakValleyPriceService {
    @Override
    public RoomDevicePeakValleyPrice getRoomDevicePeakValleyPrice(Long devicePriceId) {
        return this.baseMapper.selectOne(new LambdaQueryWrapper<RoomDevicePeakValleyPrice>()
                .eq(RoomDevicePeakValleyPrice::getRoomDeviceId, devicePriceId)
                .eq(RoomDevicePeakValleyPrice::getDeleted, 0));
    }
}
